package org.lyl.taobao.api.entity;

import lombok.Data;

/**
 * @Author: Re
 * @Date: 2021/3/26 14:05
 */
@Data
public class User {
    private int userId;
    private String img;
    private String userName;
    private String userPassword;
    private float balance;
    private String userGrade;

    public User() {
    }

    public User(String userName, String userPassword, float balance, String userGrade) {
        this.userName = userName;
        this.userPassword = userPassword;
        this.balance = balance;
        this.userGrade = userGrade;
    }

    public User(int userId, String img, String userName, String userPassword, float balance, String userGrade) {
        this.userId = userId;
        this.img = img;
        this.userName = userName;
        this.userPassword = userPassword;
        this.balance = balance;
        this.userGrade = userGrade;
    }

    public User(int userId, String userName, String userPassword, float balance, String userGrade) {
        this.userId = userId;
        this.userName = userName;
        this.userPassword = userPassword;
        this.balance = balance;
        this.userGrade = userGrade;
    }

    public User(String userName, String userPassword, String userGrade) {
        this.userName = userName;
        this.userPassword = userPassword;
        this.userGrade = userGrade;
    }
    @Override
    public String toString() {
        String grade = this.userGrade == "1" ? "用户" : "管理员";
        return "User{" +
                "userName='" + userName + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", userGrade='" +  + '\'' +
                '}';
    }
}
